<template>
  <div class="pop" v-show="setflag">
    <div class="popBox" :style="{top:top+'px',left:left+'px'}" ref="popBorder">
      <div class="pop-one bor-bot">
        <div class="pop-bednum">
          <span class="pop-num">49</span>
          <span class="pop-bed">床</span>
        </div>
        <div class="pop-info">
          <div class="popInfo-first">
            <span style="margin-right: 0.1rem;">1011321045</span>
            <span>责任医生: 焦晨峰</span>
          </div>
          <div class="popInfo-first">
            <span style="margin-right: 0.2rem;">冯建军</span>
            <span style="margin-right: 0.2rem;">男</span>
            <span>41岁</span>
          </div>
        </div>
      </div>
      <ul class="pop-two bor-bot">
        <li class="popTwo-li" v-for="(item,index) in bgList" :key="index">
          <img :src="item.bgimg" alt>
        </li>
      </ul>
      <ul class="pop-three bor-bot">
        <li class="popThree-li" v-for="(item,index) in list" :key="index">{{item.data}}</li>
      </ul>
      <div class="pop-four">
        <span style="margin-top: 0.1rem; display: block; height: 0.4rem;">诺和锐30（笔芯）*【市公乙10】</span>
        <span style="display: block;">皮下注射早餐前19.0000u</span>
        <div class="button f-right" @click="closepop">关闭</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [
        { data: '2019.06.06（入院）' },
        { data: '慢性肾炎' },
        { data: '二级护理' }
      ],
      bgList: [
        { bgimg: '../../../static/images/correct.png' },
        { bgimg: '../../../static/images/oval.png' },
        { bgimg: '../../../static/images/time.png' },
        { bgimg: '../../../static/images/error.png' },
        { bgimg: '../../../static/images/bolt.png' }
      ],
      setflag: true,
      top: 0,
      left: 0
    }
  },
  methods: {
    closepop: function () {
      this.$emit('hideTips', false)
    },
    changePosition (param1, param2) {
      this.left = 1
      this.$nextTick(function () {
        this.top = param1 - Number(this.$refs.popBorder.offsetHeight) - 28
        this.left = param2 - Number(this.$refs.popBorder.offsetWidth) / 2
      })
    }
  }
}
</script>
<style lang="stylus" scoped>
.pop {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.3);

  .popBox {
    position: absolute;
    width: 5.2rem;
    // height: 4.5rem;
    background-color: #fff;
    padding: 0.28rem 0.2rem 0.2rem 0.2rem;
    border-radius: 0.15rem;
    // top: 0;
    // left: 0;
    // margin-top: 50%;
    // margin-left: 50%;
    .pop-one {
      height: 0.8rem;

      .pop-bednum {
        width: 0.98rem;
        height: 0.65rem;
        border-radius: 0.1rem;
        background-color: #29b8ff;
        text-align: center;
        line-height: 0.65rem;
        color: #fff;
        display: inline-block;
        vertical-align: top;
        margin-right: 0.15rem;

        .pop-num {
          font-size: 0.4rem;
        }

        .pop-bed {
          font-size: 0.26rem;
        }
      }
      .pop-info {
        display: inline-block;
        vertical-align: top;
        height: 0.8rem;
        font-size: 0.26rem;
        color: #021233;

        .popInfo-first {
          height: 0.4rem;
          line-height: 0.25rem;
        }

        .popInfo-scend {
          height: 0.4rem;
        }
      }
    }

    .pop-two {
      height: 0.7rem;
      line-height: 0.7rem;
      display: flex;

      .popTwo-li {
        width: 0.4rem;
        height: 0.4rem;
        margin-right: 0.3rem;
      }
    }

    .pop-three {
      height: 1.5rem;

      .popThree-li {
        height: 0.33rem;
        line-height: 0.33rem;
        padding-left: 0.15rem;
        border-left: 4px solid #29b8ff;
        margin-top: 0.18rem;
        color: #021233;
        font-size: 0.26rem;
      }
    }

    .pop-four {
      height: 1.5rem;
      color: #021233;
      font-size: 0.26rem;

      .button {
        width: 0.93rem;
        height: 0.45rem;
        background-color: #29b8ff;
        border-radius: 0.07rem;
        text-align: center;
        line-height: 0.45rem;
        color: #fff;
      }
    }
  }
  .popBox:before{
    content:'';
    position: absolute;
    width:0;
    height: 0;
    border: 0.1rem solid transparent;
    border-top: 0.1rem solid #fff;
    border-bottom: 0;
    bottom: -0.09rem;
    left: 50%;
    margin-left: -0.05rem;
  }
}

.bor-bot {
  border-bottom: 1px solid #d3dfeb;
}
</style>
